local name, DB = ...

DB.Line = DB.Frame{
	class = "Statusbar",
	constructor = function (self, parent)
		local text = self:CreateFontString(nil, "OVERLAY")
		text:SetFontObject(DB.LineFont)
		text:SetAllPoints()
		self.text = text
		local background = self:CreateTexture(nil, "BACKGROUND")
		background:SetAllPoints()
		background:SetTexture(0,0,0,0.5)
		self:SetSize(parent:GetLineSize())
		self:SetStatusBarTexture(DB.SV.LineTexture)
		self:SetStatusBarColor(unpack(DB.SV.LineColor))
	end,
	Set = function (self, name, events, value, max, total)
		self:SetMinMaxValues(0, max)
		self:SetValue(value)
		self.text:SetFormattedText("%s - %d (%.1f%%)", name or "*Unknown*", value, value / total * 100)
	end,
}
